/*
 * Copyright (C) 2010,2011  Paulo Cesar Pereira de Andrade.
 *
 * This is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * Authors:
 *	Paulo Cesar Pereira de Andrade
 */

/*
 * Prototypes
 */
#if PROTO
static void
fp_pow_f_fp(f_t *u, f_t v, f_t *w, eint32_t m);

static void
fp_pow_fp_f(f_t *u, f_t *v, f_t w, eint32_t m);

static void
fp_pow_fp_fp(f_t *u, f_t *v, f_t *w, eint32_t m);

static void
dp_pow_d_dp(d_t *u, d_t v, d_t *w, eint32_t m);

static void
dp_pow_dp_d(d_t *u, d_t *v, d_t w, eint32_t m);

static void
dp_pow_dp_dp(d_t *u, d_t *v, d_t *w, eint32_t m);

static inline void
d_pow_i_d(vo_t *u, eint_t a, efloat_t b);

static inline void
d_pow_i_q(vo_t *u, eint_t a, empq_t b);

static inline void
d_pow_d_d(vo_t *u, efloat_t a, efloat_t b);

static inline void
d_pow_d_q(vo_t *u, efloat_t a, empq_t b);

static inline void
d_pow_z_d(vo_t *u, empz_t a, efloat_t b);

static inline void
d_pow_z_q(vo_t *u, empz_t a, empq_t b);

static inline void
d_pow_q_d(vo_t *u, empq_t a, efloat_t b);

static inline void
d_pow_q_q(vo_t *u, empq_t a, empq_t b);

static inline void
r_pow_i_q(vo_t *u, eint_t a, empq_t b);

static inline void
r_pow_i_r(vo_t *u, eint_t a, empr_t b);

static inline void
r_pow_d_r(vo_t *u, efloat_t a, empr_t b);

static inline void
r_pow_z_q(vo_t *u, empz_t a, empq_t b);

static inline void
r_pow_z_r(vo_t *u, empz_t a, empr_t b);

static inline void
r_pow_q_q(vo_t *u, empq_t a, empq_t b);

static inline void
r_pow_q_r(vo_t *u, empq_t a, empr_t b);

static inline void
r_pow_r_d(vo_t *u, empr_t a, efloat_t b);

static inline void
r_pow_r_q(vo_t *u, empr_t a, empq_t b);

static inline void
r_pow_r_r(vo_t *u, empr_t a, empr_t b);

static void
vo_pow_i_vo__d(vo_t *u, i_t v, vo_t *w, eint32_t m);

static void
vo_pow_vo_i__d(vo_t *u, vo_t *v, i_t w, eint32_t m);

static void
vo_pow_i_vo__r(vo_t *u, i_t v, vo_t *w, eint32_t m);

static void
vo_pow_vo_i__r(vo_t *u, vo_t *v, i_t w, eint32_t m);

static void
vo_pow_d_vo(vo_t *u, d_t v, vo_t *w, eint32_t m);

static void
vo_pow_vo_d(vo_t *u, vo_t *v, d_t w, eint32_t m);

static void
vo_pow_z_vo__d(vo_t *u, empz_t v, vo_t *w, eint32_t m);

static void
vo_pow_vo_z__d(vo_t *u, vo_t *v, empz_t w, eint32_t m);

static void
vo_pow_z_vo__r(vo_t *u, empz_t v, vo_t *w, eint32_t m);

static void
vo_pow_vo_z__r(vo_t *u, vo_t *v, empz_t w, eint32_t m);

static void
vo_pow_q_vo__d(vo_t *u, empq_t v, vo_t *w, eint32_t m);

static void
vo_pow_vo_q__d(vo_t *u, vo_t *v, empq_t w, eint32_t m);

static void
vo_pow_q_vo__r(vo_t *u, empq_t v, vo_t *w, eint32_t m);

static void
vo_pow_vo_q__r(vo_t *u, vo_t *v, empq_t w, eint32_t m);

static void
vo_pow_r_vo(vo_t *u, empr_t v, vo_t *w, eint32_t m);

static void
vo_pow_vo_r(vo_t *u, vo_t *v, empr_t w, eint32_t m);

static void
vo_pow_dd_vo(vo_t *u, ecdd_t v, vo_t *w, eint32_t m);

static void
vo_pow_vo_dd(vo_t *u, vo_t *v, ecdd_t w, eint32_t m);

static void
vo_pow_qq_vo__d(vo_t *u, ecqq_t v, vo_t *w, eint32_t m);

static void
vo_pow_vo_qq__d(vo_t *u, vo_t *v, ecqq_t w, eint32_t m);

static void
vo_pow_qq_vo__r(vo_t *u, ecqq_t v, vo_t *w, eint32_t m);

static void
vo_pow_vo_qq__r(vo_t *u, vo_t *v, ecqq_t w, eint32_t m);

static void
vo_pow_cc_vo(vo_t *u, empc_t v, vo_t *w, eint32_t m);

static void
vo_pow_vo_cc(vo_t *u, vo_t *v, empc_t w, eint32_t m);

static void
vo_pow_vo_vo__d(vo_t *u, vo_t *v, vo_t *w, eint32_t m);

static void
vo_pow_vo_vo__r(vo_t *u, vo_t *v, vo_t *w, eint32_t m);

static void
o_pow_o_o__d(o_t *u, o_t *v, o_t *w);

static void
o_pow_o_o__r(o_t *u, o_t *v, o_t *w);
#endif

/*
 * Implementation
 */
#if CODE
void
evector_int_pow(eint_t a, evector_t *b, etype_t t)
{
    eint32_t	 l;
    evector_t	*v;
    etype_t	 vt;
    v_enter();

    l = b->length;
    v_check(2);
    if (!thread_self->flt) {
	vt = match(t_int, t, 0, 1);
	if (vt != t)
	    b = coerce(b, t, vt);
	v = create(b, vt);
	switch (vt) {
	    case t_float32:
		fp_pow_f_fp(v->v.obj, a, b->v.obj, l);
		break;
	    case t_float64:
		dp_pow_d_dp(v->v.obj, a, b->v.obj, l);
		break;
	    default:
		vo_pow_i_vo__d(v->v.obj, a, b->v.obj, l);
		break;
	}
    }
    else {
	if (t != t_void)
	    b = coerce(b, t, t_void);
	v = create(b, t_void);
	vo_pow_i_vo__r(v->v.obj, a, b->v.obj, l);
    }
    v_leave();
}

void
evector_pow_int(evector_t *a, eint_t b, etype_t t)
{
    eint32_t	 l;
    evector_t	*v;
    etype_t	 vt;
    v_enter();

    l = a->length;
    v_check(2);
    if (!thread_self->flt) {
	vt = match(t_int, t, 0, 1);
	if (vt != t)
	    a = coerce(a, t, vt);
	v = create(a, vt);
	switch (vt) {
	    case t_float32:
		fp_pow_fp_f(v->v.obj, a->v.obj, b, l);
		break;
	    case t_float64:
		dp_pow_dp_d(v->v.obj, a->v.obj, b, l);
		break;
	    default:
		vo_pow_vo_i__d(v->v.obj, a->v.obj, b, l);
		break;
	}
    }
    else {
	if (t != t_void)
	    a = coerce(a, t, t_void);
	v = create(a, t_void);
	vo_pow_vo_i__r(v->v.obj, a->v.obj, b, l);
    }
    v_leave();
}

void
evector_float_pow(efloat_t a, evector_t *b, etype_t t)
{
    eint32_t	 l;
    evector_t	*v;
    etype_t	 vt;
    v_enter();

    l = b->length;
    v_check(2);
    vt = match(t_float, t, 0, 0);
    if (vt != t)
	b = coerce(b, t, vt);
    v = create(b, vt);
    switch (vt) {
	case t_float64:
	    dp_pow_d_dp(v->v.obj, a, b->v.obj, l);
	    break;
	default:
	    vo_pow_d_vo(v->v.obj, a, b->v.obj, l);
	    break;
    }
    v_leave();
}

void
evector_pow_float(evector_t *a, efloat_t b, etype_t t)
{
    eint32_t	 l;
    evector_t	*v;
    etype_t	 vt;
    v_enter();

    l = a->length;
    v_check(2);
    vt = match(t_float, t, 0, 0);
    if (vt != t)
	a = coerce(a, t, vt);
    v = create(a, vt);
    switch (vt) {
	case t_float64:
	    dp_pow_dp_d(v->v.obj, a->v.obj, b, l);
	    break;
	default:
	    vo_pow_vo_d(v->v.obj, a->v.obj, b, l);
	    break;
    }
    v_leave();
}

void
evector_mpz_pow(empz_t a, evector_t *b, etype_t t)
{
    eint32_t	 l;
    evector_t	*v;
    etype_t	 vt;
    v_enter();

    l = b->length;
    v_check(2);
    if (!thread_self->flt) {
	vt = match(t_int, t, 0, 1);
	if (vt != t)
	    b = coerce(b, t, vt);
	v = create(b, vt);
	switch (vt) {
	    case t_float32:
		fp_pow_f_fp(v->v.obj, mpz_get_d(a), b->v.obj, l);
		break;
	    case t_float64:
		dp_pow_d_dp(v->v.obj, mpz_get_d(a), b->v.obj, l);
		break;
	    default:
		vo_pow_z_vo__d(v->v.obj, a, b->v.obj, l);
		break;
	}
    }
    else {
	if (t != t_void)
	    b = coerce(b, t, t_void);
	v = create(b, t_void);
	vo_pow_z_vo__r(v->v.obj, a, b->v.obj, l);
    }
    v_leave();
}

void
evector_pow_mpz(evector_t *a, empz_t b, etype_t t)
{
    eint32_t	 l;
    evector_t	*v;
    etype_t	 vt;
    v_enter();

    l = a->length;
    v_check(2);
    if (!thread_self->flt) {
	vt = match(t_int, t, 0, 1);
	if (vt != t)
	    a = coerce(a, t, vt);
	v = create(a, vt);
	switch (vt) {
	    case t_float32:
		fp_pow_fp_f(v->v.obj, a->v.obj, mpz_get_d(b), l);
		break;
	    case t_float64:
		dp_pow_dp_d(v->v.obj, a->v.obj, mpz_get_d(b), l);
		break;
	    default:
		vo_pow_vo_z__d(v->v.obj, a->v.obj, b, l);
		break;
	}
    }
    else {
	if (t != t_void)
	    a = coerce(a, t, t_void);
	v = create(a, t_void);
	vo_pow_vo_z__r(v->v.obj, a->v.obj, b, l);
    }
    v_leave();
}

void
evector_mpq_pow(empq_t a, evector_t *b, etype_t t)
{
    eint32_t	 l;
    evector_t	*v;
    etype_t	 vt;
    v_enter();

    l = b->length;
    v_check(2);
    if (!thread_self->flt) {
	vt = match(t_int, t, 0, 1);
	if (vt != t)
	    b = coerce(b, t, vt);
	v = create(b, vt);
	switch (vt) {
	    case t_float32:
		fp_pow_f_fp(v->v.obj, mpq_get_d(a), b->v.obj, l);
		break;
	    case t_float64:
		dp_pow_d_dp(v->v.obj, mpq_get_d(a), b->v.obj, l);
		break;
	    default:
		vo_pow_q_vo__d(v->v.obj, a, b->v.obj, l);
		break;
	}
    }
    else {
	if (t != t_void)
	    b = coerce(b, t, t_void);
	v = create(b, t_void);
	vo_pow_q_vo__r(v->v.obj, a, b->v.obj, l);
    }
    v_leave();
}

void
evector_pow_mpq(evector_t *a, empq_t b, etype_t t)
{
    eint32_t	 l;
    evector_t	*v;
    etype_t	 vt;
    v_enter();

    l = a->length;
    v_check(2);
    if (!thread_self->flt) {
	vt = match(t_int, t, 0, 1);
	if (vt != t)
	    a = coerce(a, t, vt);
	v = create(a, vt);
	switch (vt) {
	    case t_float32:
		fp_pow_fp_f(v->v.obj, a->v.obj, mpq_get_d(b), l);
		break;
	    case t_float64:
		dp_pow_dp_d(v->v.obj, a->v.obj, mpq_get_d(b), l);
		break;
	    default:
		vo_pow_vo_q__d(v->v.obj, a->v.obj, b, l);
		break;
	}
    }
    else {
	if (t != t_void)
	    a = coerce(a, t, t_void);
	v = create(a, t_void);
	vo_pow_vo_q__r(v->v.obj, a->v.obj, b, l);
    }
    v_leave();
}

void
evector_mpr_pow(empr_t a, evector_t *b, etype_t t)
{
    evector_t	*v;
    v_enter();

    v_check(2);
    if (t != t_void)
	b = coerce(b, t, t_void);
    v = create(b, t_void);
    vo_pow_r_vo(v->v.obj, a, b->v.obj, v->length);
    v_leave();
}

void
evector_pow_mpr(evector_t *a, empr_t b, etype_t t)
{
    evector_t	*v;
    v_enter();

    v_check(2);
    if (t != t_void)
	a = coerce(a, t, t_void);
    v = create(a, t_void);
    vo_pow_vo_r(v->v.obj, a->v.obj, b, v->length);
    v_leave();
}

void
evector_cdd_pow(ecdd_t a, evector_t *b, etype_t t)
{
    evector_t	*v;
    v_enter();

    v_check(2);
    if (t != t_void)
	b = coerce(b, t, t_void);
    v = create(b, t_void);
    vo_pow_dd_vo(v->v.obj, a, b->v.obj, v->length);
    v_leave();
}

void
evector_pow_cdd(evector_t *a, ecdd_t b, etype_t t)
{
    evector_t	*v;
    v_enter();

    v_check(2);
    if (t != t_void)
	a = coerce(a, t, t_void);
    v = create(a, t_void);
    vo_pow_vo_dd(v->v.obj, a->v.obj, b, v->length);
    v_leave();
}

void
evector_cqq_pow(ecqq_t a, evector_t *b, etype_t t)
{
    evector_t	*v;
    v_enter();

    v_check(2);
    if (t != t_void)
	b = coerce(b, t, t_void);
    v = create(b, t_void);
    if (!thread_self->flt)
	vo_pow_qq_vo__d(v->v.obj, a, b->v.obj, v->length);
    else
	vo_pow_qq_vo__r(v->v.obj, a, b->v.obj, v->length);
    v_leave();
}

void
evector_pow_cqq(evector_t *a, ecqq_t b, etype_t t)
{
    evector_t	*v;
    v_enter();

    v_check(2);
    if (t != t_void)
	a = coerce(a, t, t_void);
    v = create(a, t_void);
    if (!thread_self->flt)
	vo_pow_vo_qq__d(v->v.obj, a->v.obj, b, v->length);
    else
	vo_pow_vo_qq__r(v->v.obj, a->v.obj, b, v->length);
    v_leave();
}

void
evector_mpc_pow(empc_t a, evector_t *b, etype_t t)
{
    evector_t	*v;
    v_enter();

    v_check(2);
    if (t != t_void)
	b = coerce(b, t, t_void);
    v = create(b, t_void);
    vo_pow_cc_vo(v->v.obj, a, b->v.obj, v->length);
    v_leave();
}

void
evector_pow_mpc(evector_t *a, empc_t b, etype_t t)
{
    evector_t	*v;
    v_enter();

    v_check(2);
    if (t != t_void)
	a = coerce(a, t, t_void);
    v = create(a, t_void);
    vo_pow_vo_cc(v->v.obj, a->v.obj, b, v->length);
    v_leave();
}

void
evector_pow(evector_t *a, evector_t *b, etype_t at, etype_t bt)
{
    eint32_t	l;
    evop_t	o;
    v_enter();

    setup(&o, a, b, at, bt, 0, 1);
    l = o.r->length;
    switch (o.t) {
	case t_float32:
	    fp_pow_fp_fp(o.r->v.obj, o.a->v.obj, o.b->v.obj, l);
	    break;
	case t_float64:
	    dp_pow_dp_dp(o.r->v.obj, o.a->v.obj, o.b->v.obj, l);
	    break;
	default:
	    if (!thread_self->flt)
		vo_pow_vo_vo__d(o.r->v.obj, o.a->v.obj, o.b->v.obj, l);
	    else
		vo_pow_vo_vo__r(o.r->v.obj, o.a->v.obj, o.b->v.obj, l);
	    break;
    }
    v_leave();
}

static void
fp_pow_f_fp(f_t *u, f_t v, f_t *w, eint32_t m)
{
    while (m--)
	*u++ = powf(v, *w++);
}

static void
fp_pow_fp_f(f_t *u, f_t *v, f_t w, eint32_t m)
{
    while (m--)
	*u++ = powf(*v++, w);
}

static void
fp_pow_fp_fp(f_t *u, f_t *v, f_t *w, eint32_t m)
{
    while (m--)
	*u++ = powf(*v++, *w++);
}

static void
dp_pow_d_dp(d_t *u, d_t v, d_t *w, eint32_t m)
{
    while (m--)
	*u++ = pow(v, *w++);
}

static void
dp_pow_dp_d(d_t *u, d_t *v, d_t w, eint32_t m)
{
    while (m--)
	*u++ = pow(*v++, w);
}

static void
dp_pow_dp_dp(d_t *u, d_t *v, d_t *w, eint32_t m)
{
    while (m--)
	*u++ = pow(*v++, *w++);
}

static inline void
d_pow_i_d(vo_t *u, eint_t a, efloat_t b)
{
    if (a < 0 && finite(b) && rint(b) != b)
	set_dd(edd_pow_i_d(a, b));
    else
	set_d(ed_pow_i_d(a, b));
}

static inline void
d_pow_i_q(vo_t *u, eint_t a, empq_t b)
{
    if (a < 0)
	set_dd(edd_pow_i_q(a, b));
    else
	set_d(ed_pow_i_q(a, b));
}

static inline void
d_pow_d_d(vo_t *u, efloat_t a, efloat_t b)
{
    if (a < 0.0 && finite(b) && rint(b) != b)
	set_dd(edd_pow_d_d(a, b));
    else
	set_d(ed_pow_d_d(a, b));
}

static inline void
d_pow_d_q(vo_t *u, efloat_t a, empq_t b)
{
    if (a < 0.0)
	set_dd(edd_pow_d_q(a, b));
    else
	set_d(ed_pow_d_q(a, b));
}

static inline void
d_pow_z_d(vo_t *u, empz_t a, efloat_t b)
{
    if (mpz_sgn(a) < 0 && finite(b) && rint(b) != b)
	set_dd(edd_pow_z_d(a, b));
    else
	set_d(ed_pow_z_d(a, b));
}

static inline void
d_pow_z_q(vo_t *u, empz_t a, empq_t b)
{
    if (mpz_sgn(a) < 0)
	set_dd(edd_pow_z_q(a, b));
    else
	set_d(ed_pow_z_q(a, b));
}

static inline void
d_pow_q_d(vo_t *u, empq_t a, efloat_t b)
{
    if (mpq_sgn(a) < 0 && finite(b) && rint(b) != b)
	set_dd(edd_pow_q_d(a, b));
    else
	set_d(ed_pow_q_d(a, b));
}

static inline void
d_pow_q_q(vo_t *u, empq_t a, empq_t b)
{
    if (mpq_sgn(a) < 0)
	set_dd(edd_pow_q_q(a, b));
    else
	set_d(ed_pow_q_q(a, b));
}

static inline void
r_pow_i_q(vo_t *u, eint_t a, empq_t b)
{
    if (a < 0) {
	ecc_pow_i_q(thr_c, a, b);
	set_cc(thr_c);
    }
    else {
	er_pow_i_q(thr_rr, a, b);
	set_r(thr_rr);
    }
}

static inline void
r_pow_i_r(vo_t *u, eint_t a, empr_t b)
{
    if (a < 0 && mpfr_number_p(b) && !mpfr_integer_p(b)) {
	ecc_pow_i_r(thr_c, a, b);
	set_cc(thr_c);
    }
    else {
	er_pow_i_r(thr_rr, a, b);
	set_r(thr_rr);
    }
}

static inline void
r_pow_d_r(vo_t *u, efloat_t a, empr_t b)
{
    if (finite(a) && a < 0.0 && mpfr_number_p(b) && !mpfr_integer_p(b)) {
	ecc_pow_d_r(thr_c, a, b);
	set_cc(thr_c);
    }
    else {
	er_pow_d_r(thr_rr, a, b);
	set_r(thr_rr);
    }
}

static inline void
r_pow_z_q(vo_t *u, empz_t a, empq_t b)
{
    if (mpz_sgn(a) < 0) {
	ecc_pow_z_q(thr_c, a, b);
	set_cc(thr_c);
    }
    else {
	er_pow_z_q(thr_rr, a, b);
	set_r(thr_rr);
    }
}

static inline void
r_pow_z_r(vo_t *u, empz_t a, empr_t b)
{
    if (mpz_sgn(a) < 0 && mpfr_number_p(b) && !mpfr_integer_p(b)) {
	ecc_pow_z_r(thr_c, a, b);
	set_cc(thr_c);
    }
    else {
	er_pow_z_r(thr_rr, a, b);
	set_r(thr_rr);
    }
}

static inline void
r_pow_q_q(vo_t *u, empq_t a, empq_t b)
{
    if (mpq_sgn(a) < 0) {
	ecc_pow_q_q(thr_c, a, b);
	set_cc(thr_c);
    }
    else {
	er_pow_q_q(thr_rr, a, b);
	set_r(thr_rr);
    }
}

static inline void
r_pow_q_r(vo_t *u, empq_t a, empr_t b)
{
    if (mpq_sgn(a) < 0 && mpfr_number_p(b) && !mpfr_integer_p(b)) {
	ecc_pow_q_r(thr_c, a, b);
	set_cc(thr_c);
    }
    else {
	er_pow_q_r(thr_rr, a, b);
	set_r(thr_rr);
    }
}

static inline void
r_pow_r_d(vo_t *u, empr_t a, efloat_t b)
{
    if (mpfr_number_p(a) && mpfr_sgn(a) < 0 && finite(b) && rint(b) != b) {
	ecc_pow_r_d(thr_c, a, b);
	set_cc(thr_c);
    }
    else {
	er_pow_r_d(thr_rr, a, b);
	set_r(thr_rr);
    }
}

static inline void
r_pow_r_q(vo_t *u, empr_t a, empq_t b)
{
    if (mpfr_number_p(a) && mpfr_sgn(a) < 0) {
	ecc_pow_r_q(thr_c, a, b);
	set_cc(thr_c);
    }
    else {
	er_pow_r_q(thr_rr, a, b);
	set_r(thr_rr);
    }
}

static inline void
r_pow_r_r(vo_t *u, empr_t a, empr_t b)
{
    if (mpfr_number_p(a) && mpfr_sgn(a) < 0 &&
	mpfr_number_p(b) && !mpfr_integer_p(b)) {
	ecc_pow_r_r(thr_c, a, b);
	set_cc(thr_c);
    }
    else {
	er_pow_r_r(thr_rr, a, b);
	set_r(thr_rr);
    }
}

static void
vo_pow_i_vo__d(vo_t *u, i_t v, vo_t *w, eint32_t m)
{
    for (; m; u++, w++, m--) {
	switch (eobject_type(*w)) {
	    case t_void:
		set_d(ed_pow_i_d(v, 0.0));
		break;
	    case t_int:
		set_d(ed_pow_i_i(v, get_i(w)));
		break;
	    case t_float:
		d_pow_i_d(u, v, get_d(w));
		break;
	    case t_mpz:
		set_d(ed_pow_i_z(v, get_z(w)));
		break;
	    case t_mpq:
		d_pow_i_q(u, v, get_q(w));
		break;
	    case t_mpr:
		r_pow_i_r(u, v, get_r(w));
		break;
	    case t_cdd:
		set_dd(edd_pow_i_dd(v, get_dd(w)));
		break;
	    case t_cqq:
		set_dd(edd_pow_i_qq(v, get_qq(w)));
		break;
	    case t_mpc:
		ecc_pow_i_cc(thr_c, v, get_cc(w));
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_vo_i__d(vo_t *u, vo_t *v, i_t w, eint32_t m)
{
    for (; m; u++, v++, m--) {
	switch (eobject_type(*v)) {
	    case t_void:
		set_d(ed_pow_d_i(0.0, w));
		break;
	    case t_int:
		set_d(ed_pow_i_i(get_i(v), w));
		break;
	    case t_float:
		set_d(ed_pow_d_i(get_d(v), w));
		break;
	    case t_mpz:
		set_d(ed_pow_z_i(get_z(v), w));
		break;
	    case t_mpq:
		set_d(ed_pow_q_i(get_q(v), w));
		break;
	    case t_mpr:
		er_pow_r_i(thr_rr, get_r(v), w);
		set_r(thr_rr);
		break;
	    case t_cdd:
		set_dd(edd_pow_dd_i(get_dd(v), w));
		break;
	    case t_cqq:
		set_dd(edd_pow_qq_i(get_qq(v), w));
		break;
	    case t_mpc:
		ecc_pow_cc_i(thr_c, get_cc(v), w);
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_i_vo__r(vo_t *u, i_t v, vo_t *w, eint32_t m)
{
    for (; m; u++, w++, m--) {
	switch (eobject_type(*w)) {
	    case t_void:
		er_pow_i_i(thr_rr, v, 0);
		set_r(thr_rr);
		break;
	    case t_int:
		er_pow_i_i(thr_rr, v, get_i(w));
		set_r(thr_rr);
		break;
	    case t_float:
		d_pow_i_d(u, v, get_d(w));
		break;
	    case t_mpz:
		er_pow_i_z(thr_rr, v, get_z(w));
		set_r(thr_rr);
		break;
	    case t_mpq:
		r_pow_i_q(u, v, get_q(w));
		break;
	    case t_mpr:
		r_pow_i_r(u, v, get_r(w));
		break;
	    case t_cdd:
		set_dd(edd_pow_i_dd(v, get_dd(w)));
		break;
	    case t_cqq:
		ecc_pow_i_qq(thr_c, v, get_qq(w));
		set_cc(thr_c);
		break;
	    case t_mpc:
		ecc_pow_i_cc(thr_c, v, get_cc(w));
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_vo_i__r(vo_t *u, vo_t *v, i_t w, eint32_t m)
{
    for (; m; u++, v++, m--) {
	switch (eobject_type(*v)) {
	    case t_void:
		er_pow_i_i(thr_rr, 0, w);
		set_r(thr_rr);
		break;
	    case t_int:
		er_pow_i_i(thr_rr, get_i(v), w);
		set_r(thr_rr);
		break;
	    case t_float:
		set_d(ed_pow_d_i(get_d(v), w));
		break;
	    case t_mpz:
		er_pow_z_i(thr_rr, get_z(v), w);
		set_r(thr_rr);
		break;
	    case t_mpq:
		er_pow_q_i(thr_rr, get_q(v), w);
		set_r(thr_rr);
		break;
	    case t_mpr:
		er_pow_r_i(thr_rr, get_r(v), w);
		set_r(thr_rr);
		break;
	    case t_cdd:
		set_dd(edd_pow_dd_i(get_dd(v), w));
		break;
	    case t_cqq:
		ecc_pow_qq_i(thr_c, get_qq(v), w);
		set_cc(thr_c);
		break;
	    case t_mpc:
		ecc_pow_cc_i(thr_c, get_cc(v), w);
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_d_vo(vo_t *u, d_t v, vo_t *w, eint32_t m)
{
    for (; m; u++, w++, m--) {
	switch (eobject_type(*w)) {
	    case t_void:
		set_d(pow(v, 0.0));
		break;
	    case t_int:
		set_d(pow(v, get_i(w)));
		break;
	    case t_float:
		d_pow_d_d(u, v, get_d(w));
		break;
	    case t_mpz:
		set_d(ed_pow_d_z(v, get_z(w)));
		break;
	    case t_mpq:
		d_pow_d_q(u, v, get_q(w));
		break;
	    case t_mpr:
		r_pow_d_r(u, v, get_r(w));
		break;
	    case t_cdd:
		set_dd(edd_pow_d_dd(v, get_dd(w)));
		break;
	    case t_cqq:
		set_dd(edd_pow_d_qq(v, get_qq(w)));
		break;
	    case t_mpc:
		ecc_pow_d_cc(thr_c, v, get_cc(w));
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_vo_d(vo_t *u, vo_t *v, d_t w, eint32_t m)
{
    for (; m; u++, v++, m--) {
	switch (eobject_type(*v)) {
	    case t_void:
		set_d(pow(0.0, w));
		break;
	    case t_int:
		d_pow_i_d(u, get_i(v), w);
		break;
	    case t_float:
		d_pow_d_d(u, get_d(v), w);
		break;
	    case t_mpz:
		d_pow_z_d(u, get_z(v), w);
		break;
	    case t_mpq:
		d_pow_q_d(u, get_q(v), w);
		break;
	    case t_mpr:
		r_pow_r_d(u, get_r(v), w);
		break;
	    case t_cdd:
		set_dd(edd_pow_dd_d(get_dd(v), w));
		break;
	    case t_cqq:
		set_dd(edd_pow_qq_d(get_qq(v), w));
		break;
	    case t_mpc:
		ecc_pow_cc_d(thr_c, get_cc(v), w);
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_z_vo__d(vo_t *u, empz_t v, vo_t *w, eint32_t m)
{
    for (; m; u++, w++, m--) {
	switch (eobject_type(*w)) {
	    case t_void:
		set_d(ed_pow_z_d(v, 0.0));
		break;
	    case t_int:
		set_d(ed_pow_z_i(v, get_i(w)));
		break;
	    case t_float:
		d_pow_z_d(u, v, get_d(w));
		break;
	    case t_mpz:
		set_d(ed_pow_z_z(v, get_z(w)));
		break;
	    case t_mpq:
		d_pow_z_q(u, v, get_q(w));
		break;
	    case t_mpr:
		r_pow_z_r(u, v, get_r(w));
		break;
	    case t_cdd:
		set_dd(edd_pow_z_dd(v, get_dd(w)));
		break;
	    case t_cqq:
		set_dd(edd_pow_z_qq(v, get_qq(w)));
		break;
	    case t_mpc:
		ecc_pow_z_cc(thr_c, v, get_cc(w));
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_vo_z__d(vo_t *u, vo_t *v, empz_t w, eint32_t m)
{
    for (; m; u++, v++, m--) {
	switch (eobject_type(*v)) {
	    case t_void:
		set_d(ed_pow_d_z(0.0, w));
		break;
	    case t_int:
		set_d(ed_pow_i_z(get_i(v), w));
		break;
	    case t_float:
		set_d(ed_pow_d_z(get_d(v), w));
		break;
	    case t_mpz:
		set_d(ed_pow_z_z(get_z(v), w));
		break;
	    case t_mpq:
		set_d(ed_pow_q_z(get_q(v), w));
		break;
	    case t_mpr:
		er_pow_r_z(thr_rr, get_r(v), w);
		set_r(thr_rr);
		break;
	    case t_cdd:
		set_dd(edd_pow_dd_z(get_dd(v), w));
		break;
	    case t_cqq:
		set_dd(edd_pow_qq_z(get_qq(v), w));
		break;
	    case t_mpc:
		ecc_pow_cc_z(thr_c, get_cc(v), w);
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_z_vo__r(vo_t *u, empz_t v, vo_t *w, eint32_t m)
{
    for (; m; u++, w++, m--) {
	switch (eobject_type(*w)) {
	    case t_void:
		er_pow_z_i(thr_rr, v, 0);
		set_r(thr_rr);
		break;
	    case t_int:
		er_pow_z_i(thr_rr, v, get_i(w));
		set_r(thr_rr);
		break;
	    case t_float:
		d_pow_z_d(u, v, get_d(w));
		break;
	    case t_mpz:
		er_pow_z_z(thr_rr, v, get_z(w));
		set_r(thr_rr);
		break;
	    case t_mpq:
		r_pow_z_q(u, v, get_q(w));
		break;
	    case t_mpr:
		r_pow_z_r(u, v, get_r(w));
		break;
	    case t_cdd:
		set_dd(edd_pow_z_dd(v, get_dd(w)));
		break;
	    case t_cqq:
		ecc_pow_z_qq(thr_c, v, get_qq(w));
		set_cc(thr_c);
		break;
	    case t_mpc:
		ecc_pow_z_cc(thr_c, v, get_cc(w));
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_vo_z__r(vo_t *u, vo_t *v, empz_t w, eint32_t m)
{
    for (; m; u++, v++, m--) {
	switch (eobject_type(*v)) {
	    case t_void:
		er_pow_i_z(thr_rr, 0, w);
		set_r(thr_rr);
		break;
	    case t_int:
		er_pow_i_z(thr_rr, get_i(v), w);
		set_r(thr_rr);
		break;
	    case t_float:
		set_d(ed_pow_d_z(get_d(v), w));
		break;
	    case t_mpz:
		er_pow_z_z(thr_rr, get_z(v), w);
		set_r(thr_rr);
		break;
	    case t_mpq:
		er_pow_q_z(thr_rr, get_q(v), w);
		set_r(thr_rr);
		break;
	    case t_mpr:
		er_pow_r_z(thr_rr, get_r(v), w);
		set_r(thr_rr);
		break;
	    case t_cdd:
		set_dd(edd_pow_dd_z(get_dd(v), w));
		break;
	    case t_cqq:
		ecc_pow_qq_z(thr_c, get_qq(v), w);
		set_cc(thr_c);
		break;
	    case t_mpc:
		ecc_pow_cc_z(thr_c, get_cc(v), w);
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_q_vo__d(vo_t *u, empq_t v, vo_t *w, eint32_t m)
{
    for (; m; u++, w++, m--) {
	switch (eobject_type(*w)) {
	    case t_void:
		set_d(ed_pow_q_d(v, 0.0));
		break;
	    case t_int:
		set_d(ed_pow_q_i(v, get_i(w)));
		break;
	    case t_float:
		d_pow_q_d(u, v, get_d(w));
		break;
	    case t_mpz:
		set_d(ed_pow_q_z(v, get_z(w)));
		break;
	    case t_mpq:
		d_pow_q_q(u, v, get_q(w));
		break;
	    case t_mpr:
		r_pow_q_r(u, v, get_r(w));
		break;
	    case t_cdd:
		set_dd(edd_pow_q_dd(v, get_dd(w)));
		break;
	    case t_cqq:
		set_dd(edd_pow_q_qq(v, get_qq(w)));
		break;
	    case t_mpc:
		ecc_pow_q_cc(thr_c, v, get_cc(w));
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_vo_q__d(vo_t *u, vo_t *v, empq_t w, eint32_t m)
{
    for (; m; u++, v++, m--) {
	switch (eobject_type(*v)) {
	    case t_void:
		set_d(ed_pow_d_q(0.0, w));
		break;
	    case t_int:
		d_pow_i_q(u, get_i(v), w);
		break;
	    case t_float:
		d_pow_d_q(u, get_d(v), w);
		break;
	    case t_mpz:
		d_pow_z_q(u, get_z(v), w);
		break;
	    case t_mpq:
		d_pow_q_q(u, get_q(v), w);
		break;
	    case t_mpr:
		r_pow_r_q(u, get_r(v), w);
		break;
	    case t_cdd:
		set_dd(edd_pow_dd_q(get_dd(v), w));
		break;
	    case t_cqq:
		set_dd(edd_pow_qq_q(get_qq(v), w));
		break;
	    case t_mpc:
		ecc_pow_cc_q(thr_c, get_cc(v), w);
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_q_vo__r(vo_t *u, empq_t v, vo_t *w, eint32_t m)
{
    for (; m; u++, w++, m--) {
	switch (eobject_type(*w)) {
	    case t_void:
		er_pow_q_i(thr_rr, v, 0);
		set_r(thr_rr);
		break;
	    case t_int:
		er_pow_q_i(thr_rr, v, get_i(w));
		set_r(thr_rr);
		break;
	    case t_float:
		d_pow_q_d(u, v, get_d(w));
		break;
	    case t_mpz:
		er_pow_q_z(thr_rr, v, get_z(w));
		set_r(thr_rr);
		break;
	    case t_mpq:
		r_pow_q_q(u, v, get_q(w));
		break;
	    case t_mpr:
		r_pow_q_r(u, v, get_r(w));
		break;
	    case t_cdd:
		set_dd(edd_pow_q_dd(v, get_dd(w)));
		break;
	    case t_cqq:
		ecc_pow_q_qq(thr_c, v, get_qq(w));
		set_cc(thr_c);
		break;
	    case t_mpc:
		ecc_pow_q_cc(thr_c, v, get_cc(w));
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_vo_q__r(vo_t *u, vo_t *v, empq_t w, eint32_t m)
{
    for (; m; u++, v++, m--) {
	switch (eobject_type(*v)) {
	    case t_void:
		er_pow_i_q(thr_rr, 0, w);
		set_r(thr_rr);
		break;
	    case t_int:
		r_pow_i_q(u, get_i(v), w);
		break;
	    case t_float:
		d_pow_d_q(u, get_d(v), w);
		break;
	    case t_mpz:
		r_pow_z_q(u, get_z(v), w);
		break;
	    case t_mpq:
		r_pow_q_q(u, get_q(v), w);
		break;
	    case t_mpr:
		r_pow_r_q(u, get_r(v), w);
		break;
	    case t_cdd:
		set_dd(edd_pow_dd_q(get_dd(v), w));
		break;
	    case t_cqq:
		ecc_pow_qq_q(thr_c, get_qq(v), w);
		set_cc(thr_c);
		break;
	    case t_mpc:
		ecc_pow_cc_q(thr_c, get_cc(v), w);
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_r_vo(vo_t *u, empr_t v, vo_t *w, eint32_t m)
{
    ebool_t	b;

    if (unlikely((b = v == thr_rr))) {
	++thread_self->esp;
	eget_mpr(v, (thread_self->esp - thread_self->ess) - 1);
	v = thread_self->esp[-1].v.o;
    }
    for (; m; u++, w++, m--) {
	switch (eobject_type(*w)) {
	    case t_void:
		er_pow_r_i(thr_rr, v, 0);
		set_r(thr_rr);
		break;
	    case t_int:
		er_pow_r_i(thr_rr, v, get_i(w));
		set_r(thr_rr);
		break;
	    case t_float:
		r_pow_r_d(u, v, get_d(w));
		break;
	    case t_mpz:
		er_pow_r_z(thr_rr, v, get_z(w));
		set_r(thr_rr);
		break;
	    case t_mpq:
		r_pow_r_q(u, v, get_q(w));
		break;
	    case t_mpr:
		r_pow_r_r(u, v, get_r(w));
		break;
	    case t_cdd:
		ecc_pow_r_dd(thr_c, v, get_dd(w));
		set_cc(thr_c);
		break;
	    case t_cqq:
		ecc_pow_r_qq(thr_c, v, get_qq(w));
		set_cc(thr_c);
		break;
	    case t_mpc:
		ecc_pow_r_cc(thr_c, v, get_cc(w));
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
    if (b)
	--thread_self->esp;
}

static void
vo_pow_vo_r(vo_t *u, vo_t *v, empr_t w, eint32_t m)
{
    ebool_t	b;

    if (unlikely((b = w == thr_rr))) {
	++thread_self->esp;
	eget_mpr(w, (thread_self->esp - thread_self->ess) - 1);
	w = thread_self->esp[-1].v.o;
    }
    for (; m; u++, v++, m--) {
	switch (eobject_type(*v)) {
	    case t_void:
		er_pow_i_r(thr_rr, 0, w);
		set_r(thr_rr);
		break;
	    case t_int:
		r_pow_i_r(u, get_i(v), w);
		break;
	    case t_float:
		r_pow_d_r(u, get_d(v), w);
		break;
	    case t_mpz:
		r_pow_z_r(u, get_z(v), w);
		break;
	    case t_mpq:
		r_pow_q_r(u, get_q(v), w);
		break;
	    case t_mpr:
		r_pow_r_r(u, get_r(v), w);
		break;
	    case t_cdd:
		ecc_pow_dd_r(thr_c, get_dd(v), w);
		set_cc(thr_c);
		break;
	    case t_cqq:
		ecc_pow_qq_r(thr_c, get_qq(v), w);
		set_cc(thr_c);
		break;
	    case t_mpc:
		ecc_pow_cc_r(thr_c, get_cc(v), w);
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
    if (b)
	--thread_self->esp;
}

static void
vo_pow_dd_vo(vo_t *u, ecdd_t v, vo_t *w, eint32_t m)
{
    for (; m; u++, w++, m--) {
	switch (eobject_type(*w)) {
	    case t_void:
		set_dd(edd_pow_dd_i(v, 0));
		break;
	    case t_int:
		set_dd(edd_pow_dd_i(v, get_i(w)));
		break;
	    case t_float:
		set_dd(edd_pow_dd_d(v, get_d(w)));
		break;
	    case t_mpz:
		set_dd(edd_pow_dd_z(v, get_z(w)));
		break;
	    case t_mpq:
		set_dd(edd_pow_dd_q(v, get_q(w)));
		break;
	    case t_mpr:
		ecc_pow_dd_r(thr_c, v, get_r(w));
		set_cc(thr_c);
		break;
	    case t_cdd:
		set_dd(edd_pow_dd_dd(v, get_dd(w)));
		break;
	    case t_cqq:
		set_dd(edd_pow_dd_qq(v, get_qq(w)));
		break;
	    case t_mpc:
		ecc_pow_dd_cc(thr_c, v, get_cc(w));
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_vo_dd(vo_t *u, vo_t *v, ecdd_t w, eint32_t m)
{
    for (; m; u++, v++, m--) {
	switch (eobject_type(*v)) {
	    case t_void:
		set_dd(edd_pow_i_dd(0, w));
		break;
	    case t_int:
		set_dd(edd_pow_i_dd(get_i(v), w));
		break;
	    case t_float:
		set_dd(edd_pow_d_dd(get_d(v), w));
		break;
	    case t_mpz:
		set_dd(edd_pow_z_dd(get_z(v), w));
		break;
	    case t_mpq:
		set_dd(edd_pow_q_dd(get_q(v), w));
		break;
	    case t_mpr:
		ecc_pow_r_dd(thr_c, get_r(v), w);
		set_cc(thr_c);
		break;
	    case t_cdd:
		set_dd(edd_pow_dd_dd(get_dd(v), w));
		break;
	    case t_cqq:
		set_dd(edd_pow_qq_dd(get_qq(v), w));
		break;
	    case t_mpc:
		ecc_pow_cc_dd(thr_c, get_cc(v), w);
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_qq_vo__d(vo_t *u, ecqq_t v, vo_t *w, eint32_t m)
{
    for (; m; u++, w++, m--) {
	switch (eobject_type(*w)) {
	    case t_void:
		set_dd(edd_pow_qq_i(v, 0));
		break;
	    case t_int:
		set_dd(edd_pow_qq_i(v, get_i(w)));
		break;
	    case t_float:
		set_dd(edd_pow_qq_d(v, get_d(w)));
		break;
	    case t_mpz:
		set_dd(edd_pow_qq_z(v, get_z(w)));
		break;
	    case t_mpq:
		set_dd(edd_pow_qq_q(v, get_q(w)));
		break;
	    case t_mpr:
		ecc_pow_qq_r(thr_c, v, get_r(w));
		set_cc(thr_c);
		break;
	    case t_cdd:
		set_dd(edd_pow_qq_dd(v, get_dd(w)));
		break;
	    case t_cqq:
		set_dd(edd_pow_qq_qq(v, get_qq(w)));
		break;
	    case t_mpc:
		ecc_pow_qq_cc(thr_c, v, get_cc(w));
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_vo_qq__d(vo_t *u, vo_t *v, ecqq_t w, eint32_t m)
{
    for (; m; u++, v++, m--) {
	switch (eobject_type(*v)) {
	    case t_void:
		set_dd(edd_pow_i_qq(0, w));
		break;
	    case t_int:
		set_dd(edd_pow_i_qq(get_i(v), w));
		break;
	    case t_float:
		set_dd(edd_pow_d_qq(get_d(v), w));
		break;
	    case t_mpz:
		set_dd(edd_pow_z_qq(get_z(v), w));
		break;
	    case t_mpq:
		set_dd(edd_pow_q_qq(get_q(v), w));
		break;
	    case t_mpr:
		ecc_pow_r_qq(thr_c, get_r(v), w);
		set_cc(thr_c);
		break;
	    case t_cdd:
		set_dd(edd_pow_dd_qq(get_dd(v), w));
		break;
	    case t_cqq:
		set_dd(edd_pow_qq_qq(get_qq(v), w));
		break;
	    case t_mpc:
		ecc_pow_cc_qq(thr_c, get_cc(v), w);
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_qq_vo__r(vo_t *u, ecqq_t v, vo_t *w, eint32_t m)
{
    for (; m; u++, w++, m--) {
	switch (eobject_type(*w)) {
	    case t_void:
		ecc_pow_qq_i(thr_c, v, 0);
		set_cc(thr_c);
		break;
	    case t_int:
		ecc_pow_qq_i(thr_c, v, get_i(w));
		set_cc(thr_c);
		break;
	    case t_float:
		set_dd(edd_pow_qq_d(v, get_d(w)));
		break;
	    case t_mpz:
		ecc_pow_qq_z(thr_c, v, get_z(w));
		set_cc(thr_c);
		break;
	    case t_mpq:
		ecc_pow_qq_q(thr_c, v, get_q(w));
		set_cc(thr_c);
		break;
	    case t_mpr:
		ecc_pow_qq_r(thr_c, v, get_r(w));
		set_cc(thr_c);
		break;
	    case t_cdd:
		set_dd(edd_pow_qq_dd(v, get_dd(w)));
		break;
	    case t_cqq:
		ecc_pow_qq_qq(thr_c, v, get_qq(w));
		set_cc(thr_c);
		break;
	    case t_mpc:
		ecc_pow_qq_cc(thr_c, v, get_cc(w));
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_vo_qq__r(vo_t *u, vo_t *v, ecqq_t w, eint32_t m)
{
    for (; m; u++, v++, m--) {
	switch (eobject_type(*v)) {
	    case t_void:
		ecc_pow_i_qq(thr_c, 0, w);
		set_cc(thr_c);
		break;
	    case t_int:
		ecc_pow_i_qq(thr_c, get_i(v), w);
		set_cc(thr_c);
		break;
	    case t_float:
		set_dd(edd_pow_d_qq(get_d(v), w));
		break;
	    case t_mpz:
		ecc_pow_z_qq(thr_c, get_z(v), w);
		set_cc(thr_c);
		break;
	    case t_mpq:
		ecc_pow_q_qq(thr_c, get_q(v), w);
		set_cc(thr_c);
		break;
	    case t_mpr:
		ecc_pow_r_qq(thr_c, get_r(v), w);
		set_cc(thr_c);
		break;
	    case t_cdd:
		set_dd(edd_pow_dd_qq(get_dd(v), w));
		break;
	    case t_cqq:
		ecc_pow_qq_qq(thr_c, get_qq(v), w);
		set_cc(thr_c);
		break;
	    case t_mpc:
		ecc_pow_cc_qq(thr_c, get_cc(v), w);
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
}

static void
vo_pow_cc_vo(vo_t *u, empc_t v, vo_t *w, eint32_t m)
{
    ebool_t	b;

    if (unlikely((b = v == thr_c))) {
	++thread_self->esp;
	eget_mpc(v, (thread_self->esp - thread_self->ess) - 1);
	v = thread_self->esp[-1].v.o;
    }
    for (; m; u++, w++, m--) {
	switch (eobject_type(*w)) {
	    case t_void:
		ecc_pow_cc_i(thr_c, v, 0);
		set_cc(thr_c);
		break;
	    case t_int:
		ecc_pow_cc_i(thr_c, v, get_i(w));
		set_cc(thr_c);
		break;
	    case t_float:
		ecc_pow_cc_d(thr_c, v, get_d(w));
		set_cc(thr_c);
		break;
	    case t_mpz:
		ecc_pow_cc_z(thr_c, v, get_z(w));
		set_cc(thr_c);
		break;
	    case t_mpq:
		ecc_pow_cc_q(thr_c, v, get_q(w));
		set_cc(thr_c);
		break;
	    case t_mpr:
		ecc_pow_cc_r(thr_c, v, get_r(w));
		set_cc(thr_c);
		break;
	    case t_cdd:
		ecc_pow_cc_dd(thr_c, v, get_dd(w));
		set_cc(thr_c);
		break;
	    case t_cqq:
		ecc_pow_cc_qq(thr_c, v, get_qq(w));
		set_cc(thr_c);
		break;
	    case t_mpc:
		ecc_pow_cc_cc(thr_c, v, get_cc(w));
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
    if (b)
	--thread_self->esp;
}

static void
vo_pow_vo_cc(vo_t *u, vo_t *v, empc_t w, eint32_t m)
{
    ebool_t	b;

    if (unlikely((b = w == thr_c))) {
	++thread_self->esp;
	eget_mpc(w, (thread_self->esp - thread_self->ess) - 1);
	w = thread_self->esp[-1].v.o;
    }
    for (; m; u++, v++, m--) {
	switch (eobject_type(*v)) {
	    case t_void:
		ecc_pow_i_cc(thr_c, 0, w);
		set_cc(thr_c);
		break;
	    case t_int:
		ecc_pow_i_cc(thr_c, get_i(v), w);
		set_cc(thr_c);
		break;
	    case t_float:
		ecc_pow_d_cc(thr_c, get_d(v), w);
		set_cc(thr_c);
		break;
	    case t_mpz:
		ecc_pow_z_cc(thr_c, get_z(v), w);
		set_cc(thr_c);
		break;
	    case t_mpq:
		ecc_pow_q_cc(thr_c, get_q(v), w);
		set_cc(thr_c);
		break;
	    case t_mpr:
		ecc_pow_r_cc(thr_c, get_r(v), w);
		set_cc(thr_c);
		break;
	    case t_cdd:
		ecc_pow_dd_cc(thr_c, get_dd(v), w);
		set_cc(thr_c);
		break;
	    case t_cqq:
		ecc_pow_qq_cc(thr_c, get_qq(v), w);
		set_cc(thr_c);
		break;
	    case t_mpc:
		ecc_pow_cc_cc(thr_c, get_cc(v), w);
		set_cc(thr_c);
		break;
	    default:
		eraise_exception(except_not_a_number);
	}
    }
    if (b)
	--thread_self->esp;
}

static void
vo_pow_vo_vo__d(vo_t *u, vo_t *v, vo_t *w, eint32_t m)
{
    for (; m; m--, u++, v++, w++)
	o_pow_o_o__d(u, v, w);
}

static void
vo_pow_vo_vo__r(vo_t *u, vo_t *v, vo_t *w, eint32_t m)
{
    for (; m; m--, u++, v++, w++)
	o_pow_o_o__r(u, v, w);
}

static void
o_pow_o_o__d(eobject_t *u, eobject_t *v, eobject_t *w)
{
    switch (eobject_type(*v)) {
	case t_void:
	    switch (eobject_type(*w)) {
		case t_void:
		    set_d(pow(0.0, 0.0));
		    break;
		case t_int:
		    set_d(pow(0.0, get_i(w)));
		    break;
		case t_float:
		    set_d(pow(0.0, get_d(w)));
		    break;
		case t_mpz:
		    set_d(ed_pow_d_z(0.0, get_z(w)));
		    break;
		case t_mpq:
		    set_d(ed_pow_d_q(0.0, get_q(w)));
		    break;
		case t_mpr:
		    er_pow_i_r(thr_rr, 0, get_r(w));
		    set_r(thr_rr);
		    break;
		case t_cdd:
		    set_dd(edd_pow_i_dd(0, get_dd(w)));
		    break;
		case t_cqq:
		    set_dd(edd_pow_i_qq(0, get_qq(w)));
		    break;
		case t_mpc:
		    ecc_pow_i_cc(thr_c, 0, get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	case t_int:
	    switch (eobject_type(*w)) {
		case t_void:
		    set_d(pow(get_i(v), 0.0));
		    break;
		case t_int:
		    set_d(pow(get_i(v), get_i(w)));
		    break;
		case t_float:
		    d_pow_i_d(u, get_i(v), get_d(w));
		    break;
		case t_mpz:
		    set_d(ed_pow_i_z(get_i(v), get_z(w)));
		    break;
		case t_mpq:
		    d_pow_i_q(u, get_i(v), get_q(w));
		    break;
		case t_mpr:
		    r_pow_i_r(u, get_i(v), get_r(w));
		    break;
		case t_cdd:
		    set_dd(edd_pow_i_dd(get_i(v), get_dd(w)));
		    break;
		case t_cqq:
		    set_dd(edd_pow_i_qq(get_i(v), get_qq(w)));
		    break;
		case t_mpc:
		    ecc_pow_i_cc(thr_c, get_i(v), get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	case t_float:
	    switch (eobject_type(*w)) {
		case t_void:
		    set_d(ed_pow_d_d(get_d(v), 0.0));
		    break;
		case t_int:
		    set_d(ed_pow_d_i(get_d(v), get_i(w)));
		    break;
		case t_float:
		    d_pow_d_d(u, get_d(v), get_d(w));
		    break;
		case t_mpz:
		    set_d(ed_pow_d_z(get_d(v), get_z(w)));
		    break;
		case t_mpq:
		    d_pow_d_q(u, get_d(v), get_q(w));
		    break;
		case t_mpr:
		    r_pow_d_r(u, get_d(v), get_r(w));
		    break;
		case t_cdd:
		    set_dd(edd_pow_d_dd(get_d(v), get_dd(w)));
		    break;
		case t_cqq:
		    set_dd(edd_pow_d_qq(get_d(v), get_qq(w)));
		    break;
		case t_mpc:
		    ecc_pow_d_cc(thr_c, get_d(v), get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	case t_mpz:
	    switch (eobject_type(*w)) {
		case t_void:
		    set_d(ed_pow_z_d(get_z(v), 0.0));
		    break;
		case t_int:
		    set_d(ed_pow_z_i(get_z(v), get_i(w)));
		    break;
		case t_float:
		    d_pow_z_d(u, get_z(v), get_d(w));
		    break;
		case t_mpz:
		    set_d(ed_pow_z_z(get_z(v), get_z(w)));
		    break;
		case t_mpq:
		    d_pow_z_q(u, get_z(v), get_q(w));
		    break;
		case t_mpr:
		    r_pow_z_r(u, get_z(v), get_r(w));
		    break;
		case t_cdd:
		    set_dd(edd_pow_z_dd(get_z(v), get_dd(w)));
		    break;
		case t_cqq:
		    set_dd(edd_pow_z_qq(get_z(v), get_qq(w)));
		    break;
		case t_mpc:
		    ecc_pow_z_cc(thr_c, get_z(v), get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	case t_mpq:
	    switch (eobject_type(*w)) {
		case t_void:
		    set_d(ed_pow_q_d(get_q(v), 0.0));
		    break;
		case t_int:
		    set_d(ed_pow_q_i(get_q(v), get_i(w)));
		    break;
		case t_float:
		    d_pow_q_d(u, get_q(v), get_d(w));
		    break;
		case t_mpz:
		    set_d(ed_pow_q_z(get_q(v), get_z(w)));
		    break;
		case t_mpq:
		    d_pow_q_q(u, get_q(v), get_q(w));
		    break;
		case t_mpr:
		    r_pow_q_r(u, get_q(v), get_r(w));
		    break;
		case t_cdd:
		    set_dd(edd_pow_q_dd(get_q(v), get_dd(w)));
		    break;
		case t_cqq:
		    set_dd(edd_pow_q_qq(get_q(v), get_qq(w)));
		    break;
		case t_mpc:
		    ecc_pow_q_cc(thr_c, get_q(v), get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	case t_mpr:
	    switch (eobject_type(*w)) {
		case t_void:
		    er_pow_r_i(thr_rr, get_r(v), 0);
		    set_r(thr_rr);
		    break;
		case t_int:
		    er_pow_r_i(thr_rr, get_r(v), get_i(w));
		    set_r(thr_rr);
		    break;
		case t_float:
		    r_pow_r_d(u, get_r(v), get_d(w));
		    break;
		case t_mpz:
		    er_pow_r_z(thr_rr, get_r(v), get_z(w));
		    set_r(thr_rr);
		    break;
		case t_mpq:
		    r_pow_r_q(u, get_r(v), get_q(w));
		    break;
		case t_mpr:
		    r_pow_r_r(u, get_r(v), get_r(w));
		    break;
		case t_cdd:
		    ecc_pow_r_dd(thr_c, get_r(v), get_dd(w));
		    set_cc(thr_c);
		    break;
		case t_cqq:
		    ecc_pow_r_qq(thr_c, get_r(v), get_qq(w));
		    set_cc(thr_c);
		    break;
		case t_mpc:
		    ecc_pow_r_cc(thr_c, get_r(v), get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	case t_cdd:
	    switch (eobject_type(*w)) {
		case t_void:
		    set_dd(edd_pow_dd_i(get_dd(v), 0));
		    break;
		case t_int:
		    set_dd(edd_pow_dd_i(get_dd(v), get_i(w)));
		    break;
		case t_float:
		    set_dd(edd_pow_dd_d(get_dd(v), get_d(w)));
		    break;
		case t_mpz:
		    set_dd(edd_pow_dd_z(get_dd(v), get_z(w)));
		    break;
		case t_mpq:
		    set_dd(edd_pow_dd_q(get_dd(v), get_q(w)));
		    break;
		case t_mpr:
		    ecc_pow_dd_r(thr_c, get_dd(v), get_r(w));
		    set_cc(thr_c);
		    break;
		case t_cdd:
		    set_dd(edd_pow_dd_dd(get_dd(v), get_dd(w)));
		    break;
		case t_cqq:
		    set_dd(edd_pow_dd_qq(get_dd(v), get_qq(w)));
		    break;
		case t_mpc:
		    ecc_pow_dd_cc(thr_c, get_dd(v), get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	case t_cqq:
	    switch (eobject_type(*w)) {
		case t_void:
		    set_dd(edd_pow_qq_i(get_qq(v), 0));
		    break;
		case t_int:
		    set_dd(edd_pow_qq_i(get_qq(v), get_i(w)));
		    break;
		case t_float:
		    set_dd(edd_pow_qq_d(get_qq(v), get_d(w)));
		    break;
		case t_mpz:
		    set_dd(edd_pow_qq_z(get_qq(v), get_z(w)));
		    break;
		case t_mpq:
		    set_dd(edd_pow_qq_q(get_qq(v), get_q(w)));
		    break;
		case t_mpr:
		    ecc_pow_qq_r(thr_c, get_qq(v), get_r(w));
		    set_cc(thr_c);
		    break;
		case t_cdd:
		    set_dd(edd_pow_qq_dd(get_qq(v), get_dd(w)));
		    break;
		case t_cqq:
		    set_dd(edd_pow_qq_qq(get_qq(v), get_qq(w)));
		    break;
		case t_mpc:
		    ecc_pow_qq_cc(thr_c, get_qq(v), get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	case t_mpc:
	    switch (eobject_type(*w)) {
		case t_void:
		    ecc_pow_cc_i(thr_c, get_cc(v), 0);
		    set_cc(thr_c);
		    break;
		case t_int:
		    ecc_pow_cc_i(thr_c, get_cc(v), get_i(w));
		    set_cc(thr_c);
		    break;
		case t_float:
		    ecc_pow_cc_d(thr_c, get_cc(v), get_d(w));
		    set_cc(thr_c);
		    break;
		case t_mpz:
		    ecc_pow_cc_z(thr_c, get_cc(v), get_z(w));
		    set_cc(thr_c);
		    break;
		case t_mpq:
		    ecc_pow_cc_q(thr_c, get_cc(v), get_q(w));
		    set_cc(thr_c);
		    break;
		case t_mpr:
		    ecc_pow_cc_r(thr_c, get_cc(v), get_r(w));
		    set_cc(thr_c);
		    break;
		case t_cdd:
		    ecc_pow_cc_dd(thr_c, get_cc(v), get_dd(w));
		    set_cc(thr_c);
		    break;
		case t_cqq:
		    ecc_pow_cc_qq(thr_c, get_cc(v), get_qq(w));
		    set_cc(thr_c);
		    break;
		case t_mpc:
		    ecc_pow_cc_cc(thr_c, get_cc(v), get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	default:
	    eraise_exception(except_not_a_number);
    }
}

static void
o_pow_o_o__r(eobject_t *u, eobject_t *v, eobject_t *w)
{
    switch (eobject_type(*v)) {
	case t_void:
	    switch (eobject_type(*w)) {
		case t_void:
		    er_pow_i_i(thr_rr, 0, 0);
		    set_r(thr_rr);
		    break;
		case t_int:
		    er_pow_i_i(thr_rr, 0, get_i(w));
		    set_r(thr_rr);
		    break;
		case t_float:
		    set_d(pow(0.0, get_d(w)));
		    break;
		case t_mpz:
		    er_pow_i_z(thr_rr, 0, get_z(w));
		    set_r(thr_rr);
		    break;
		case t_mpq:
		    er_pow_i_q(thr_rr, 0, get_q(w));
		    set_r(thr_rr);
		    break;
		case t_mpr:
		    er_pow_i_r(thr_rr, 0, get_r(w));
		    set_r(thr_rr);
		    break;
		case t_cdd:
		    set_dd(edd_pow_d_dd(0.0, get_dd(w)));
		    break;
		case t_cqq:
		    ecc_pow_i_qq(thr_c, 0, get_qq(w));
		    set_cc(thr_c);
		    break;
		case t_mpc:
		    ecc_pow_i_cc(thr_c, 0, get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	case t_int:
	    switch (eobject_type(*w)) {
		case t_void:
		    er_pow_i_i(thr_rr, get_i(v), 0);
		    set_r(thr_rr);
		    break;
		case t_int:
		    er_pow_i_i(thr_rr, get_i(v), get_i(w));
		    set_r(thr_rr);
		    break;
		case t_float:
		    set_d(pow(get_i(v), get_d(w)));
		    break;
		case t_mpz:
		    er_pow_i_z(thr_rr, get_i(v), get_z(w));
		    set_r(thr_rr);
		    break;
		case t_mpq:
		    r_pow_i_q(u, get_i(v), get_q(w));
		    break;
		case t_mpr:
		    r_pow_i_r(u, get_i(v), get_r(w));
		    break;
		case t_cdd:
		    set_dd(edd_pow_i_dd(get_i(v), get_dd(w)));
		    break;
		case t_cqq:
		    ecc_pow_i_qq(thr_c, get_i(v), get_qq(w));
		    set_cc(thr_c);
		    break;
		case t_mpc:
		    ecc_pow_i_cc(thr_c, get_i(v), get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	case t_float:
	    switch (eobject_type(*w)) {
		case t_void:
		    set_d(ed_pow_d_d(get_d(v), 0.0));
		    break;
		case t_int:
		    set_d(ed_pow_d_i(get_d(v), get_i(w)));
		    break;
		case t_float:
		    d_pow_d_d(u, get_d(v), get_d(w));
		    break;
		case t_mpz:
		    set_d(ed_pow_d_z(get_d(v), get_z(w)));
		    break;
		case t_mpq:
		    d_pow_d_q(u, get_d(v), get_q(w));
		    break;
		case t_mpr:
		    r_pow_d_r(u, get_d(v), get_r(w));
		    break;
		case t_cdd:
		    set_dd(edd_pow_d_dd(get_d(v), get_dd(w)));
		    break;
		case t_cqq:
		    set_dd(edd_pow_d_qq(get_d(v), get_qq(w)));
		    break;
		case t_mpc:
		    ecc_pow_d_cc(thr_c, get_d(v), get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	case t_mpz:
	    switch (eobject_type(*w)) {
		case t_void:
		    er_pow_z_i(thr_rr, get_z(v), 0);
		    set_r(thr_rr);
		    break;
		case t_int:
		    er_pow_z_i(thr_rr, get_z(v), get_i(w));
		    set_r(thr_rr);
		    break;
		case t_float:
		    d_pow_z_d(u, get_z(v), get_d(w));
		    break;
		case t_mpz:
		    er_pow_z_z(thr_rr, get_z(v), get_z(w));
		    set_r(thr_rr);
		    break;
		case t_mpq:
		    r_pow_z_q(u, get_z(v), get_q(w));
		    break;
		case t_mpr:
		    r_pow_z_r(u, get_z(v), get_r(w));
		    break;
		case t_cdd:
		    set_dd(edd_pow_z_dd(get_z(v), get_dd(w)));
		    break;
		case t_cqq:
		    ecc_pow_z_qq(thr_c, get_z(v), get_qq(w));
		    set_cc(thr_c);
		    break;
		case t_mpc:
		    ecc_pow_z_cc(thr_c, get_z(v), get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	case t_mpq:
	    switch (eobject_type(*w)) {
		case t_void:
		    er_pow_q_i(thr_rr, get_q(v), 0);
		    set_r(thr_rr);
		    break;
		case t_int:
		    er_pow_q_i(thr_rr, get_q(v), get_i(w));
		    set_r(thr_rr);
		    break;
		case t_float:
		    set_d(ed_pow_q_d(get_q(v), get_d(w)));
		    break;
		case t_mpz:
		    er_pow_q_z(thr_rr, get_q(v), get_z(w));
		    set_r(thr_rr);
		    break;
		case t_mpq:
		    r_pow_q_q(u, get_q(v), get_q(w));
		    break;
		case t_mpr:
		    r_pow_q_r(u, get_q(v), get_r(w));
		    break;
		case t_cdd:
		    set_dd(edd_pow_q_dd(get_q(v), get_dd(w)));
		    break;
		case t_cqq:
		    ecc_pow_q_qq(thr_c, get_q(v), get_qq(w));
		    set_cc(thr_c);
		    break;
		case t_mpc:
		    ecc_pow_q_cc(thr_c, get_q(v), get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	case t_mpr:
	    switch (eobject_type(*w)) {
		case t_void:
		    er_pow_r_i(thr_rr, get_r(v), 0);
		    set_r(thr_rr);
		    break;
		case t_int:
		    er_pow_r_i(thr_rr, get_r(v), get_i(w));
		    set_r(thr_rr);
		    break;
		case t_float:
		    r_pow_r_d(u, get_r(v), get_d(w));
		    break;
		case t_mpz:
		    er_pow_r_z(thr_rr, get_r(v), get_z(w));
		    set_r(thr_rr);
		    break;
		case t_mpq:
		    r_pow_r_q(u, get_r(v), get_q(w));
		    break;
		case t_mpr:
		    r_pow_r_r(u, get_r(v), get_r(w));
		    break;
		case t_cdd:
		    ecc_pow_r_dd(thr_c, get_r(v), get_dd(w));
		    set_cc(thr_c);
		    break;
		case t_cqq:
		    ecc_pow_r_qq(thr_c, get_r(v), get_qq(w));
		    set_cc(thr_c);
		    break;
		case t_mpc:
		    ecc_pow_r_cc(thr_c, get_r(v), get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	case t_cdd:
	    switch (eobject_type(*w)) {
		case t_void:
		    set_dd(edd_pow_dd_d(get_dd(v), 0.0));
		    break;
		case t_int:
		    set_dd(edd_pow_dd_i(get_dd(v), get_i(w)));
		    break;
		case t_float:
		    set_dd(edd_pow_dd_d(get_dd(v), get_d(w)));
		    break;
		case t_mpz:
		    set_dd(edd_pow_dd_z(get_dd(v), get_z(w)));
		    break;
		case t_mpq:
		    set_dd(edd_pow_dd_q(get_dd(v), get_q(w)));
		    break;
		case t_mpr:
		    ecc_pow_dd_r(thr_c, get_dd(v), get_r(w));
		    set_cc(thr_c);
		    break;
		case t_cdd:
		    set_dd(edd_pow_dd_dd(get_dd(v), get_dd(w)));
		    break;
		case t_cqq:
		    set_dd(edd_pow_dd_qq(get_dd(v), get_qq(w)));
		    break;
		case t_mpc:
		    ecc_pow_dd_cc(thr_c, get_dd(v), get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	case t_cqq:
	    switch (eobject_type(*w)) {
		case t_void:
		    ecc_pow_qq_i(thr_c, get_qq(v), 0);
		    set_cc(thr_c);
		    break;
		case t_int:
		    ecc_pow_qq_i(thr_c, get_qq(v), get_i(w));
		    set_cc(thr_c);
		    break;
		case t_float:
		    set_dd(edd_pow_qq_d(get_qq(v), get_d(w)));
		    break;
		case t_mpz:
		    ecc_pow_qq_z(thr_c, get_qq(v), get_z(w));
		    set_cc(thr_c);
		    break;
		case t_mpq:
		    ecc_pow_qq_q(thr_c, get_qq(v), get_q(w));
		    set_cc(thr_c);
		    break;
		case t_mpr:
		    ecc_pow_qq_r(thr_c, get_qq(v), get_r(w));
		    set_cc(thr_c);
		    break;
		case t_cdd:
		    set_dd(edd_pow_qq_dd(get_qq(v), get_dd(w)));
		    break;
		case t_cqq:
		    ecc_pow_qq_qq(thr_c, get_qq(v), get_qq(w));
		    set_cc(thr_c);
		    break;
		case t_mpc:
		    ecc_pow_qq_cc(thr_c, get_qq(v), get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	case t_mpc:
	    switch (eobject_type(*w)) {
		case t_void:
		    ecc_pow_cc_i(thr_c, get_cc(v), 0);
		    set_cc(thr_c);
		    break;
		case t_int:
		    ecc_pow_cc_i(thr_c, get_cc(v), get_i(w));
		    set_cc(thr_c);
		    break;
		case t_float:
		    ecc_pow_cc_d(thr_c, get_cc(v), get_d(w));
		    set_cc(thr_c);
		    break;
		case t_mpz:
		    ecc_pow_cc_z(thr_c, get_cc(v), get_z(w));
		    set_cc(thr_c);
		    break;
		case t_mpq:
		    ecc_pow_cc_q(thr_c, get_cc(v), get_q(w));
		    set_cc(thr_c);
		    break;
		case t_mpr:
		    ecc_pow_cc_r(thr_c, get_cc(v), get_r(w));
		    set_cc(thr_c);
		    break;
		case t_cdd:
		    ecc_pow_cc_dd(thr_c, get_cc(v), get_dd(w));
		    set_cc(thr_c);
		    break;
		case t_cqq:
		    ecc_pow_cc_qq(thr_c, get_cc(v), get_qq(w));
		    set_cc(thr_c);
		    break;
		case t_mpc:
		    ecc_pow_cc_cc(thr_c, get_cc(v), get_cc(w));
		    set_cc(thr_c);
		    break;
		default:
		    eraise_exception(except_not_a_number);
	    }
	    break;
	default:
	    eraise_exception(except_not_a_number);
    }
}
#endif
